From 64cf8b731ea294615d877d43ad8df406d0013d00 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 27 Aug 2013 15:35:46 -0400 Subject: [PATCH] gtkwindow: Consistently set the style classes for window-frame In one place, we forgot to remove the BACKGROUND style class before adding window-frame. Add a helper method so these are all the same. https://bugzilla.gnome.org/show_bug.cgi?id=706922 --- gtk/gtkwindow.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 434b2fee1f..55e508807a 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -6192,6 +6192,13 @@ sum_borders (GtkBorder *one, one->left += two->left; } +static void +add_window_frame_style_class (GtkStyleContext *context) +{ + gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BACKGROUND); + gtk_style_context_add_class (context, "window-frame"); +} + static void get_decoration_size (GtkWidget *widget, GtkBorder *decorations) @@ -6217,8 +6224,7 @@ get_decoration_size (GtkWidget *widget, context = gtk_widget_get_style_context (widget); gtk_style_context_save (context); - gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BACKGROUND); - gtk_style_context_add_class (context, "window-frame"); + add_window_frame_style_class (context); /* Always sum border + padding */ gtk_style_context_get_border (context, state, decorations); @@ -6260,7 +6266,7 @@ update_border_windows (GtkWindow *window) context = gtk_widget_get_style_context (widget); gtk_style_context_save (context); - gtk_style_context_add_class (context, "window-frame"); + add_window_frame_style_class (context); gtk_style_context_get_margin (context, gtk_widget_get_state_flags (widget), &border); @@ -9150,8 +9156,7 @@ gtk_window_draw (GtkWidget *widget, { gtk_style_context_save (context); - gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BACKGROUND); - gtk_style_context_add_class (context, "window-frame"); + add_window_frame_style_class (context); gtk_render_background (context, cr, window_border.left, window_border.top, -- 2.30.2